package com.onlineshop.highgee.common;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class BasicDao {

	public static void updateData(String sql, Connection conn, Object... args) {
		// 1:Ϊʲô connection
		try {
			PreparedStatement pst = conn.prepareStatement(sql);

			for (int i = 0; i < args.length; i++) {
				pst.setObject(i + 1, args[i]);
			}
			pst.executeUpdate();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
